<template>
  <div class="mingxi_box">
    <div class="box" v-for="(item,index) in list" :key="index">
      <block v-if="item.detailType == 1">
        <div class="left">
          <p class="title">充值成功</p>
          <p class="time">{{item.createTime}}</p>
        </div>
        <div class="right">
          <p class="price">{{item.recharge}}元</p>
          <p class="text">充值{{item.recharge}}元，赠送{{item.giveAway}}元</p>
        </div>
      </block>
      <block v-else>
        <div class="left">
          <p class="title">支付成功</p>
          <p class="time">{{item.createTime}}</p>
        </div>
        <div class="right">
          <p class="price">{{item.amountPaid}}元</p>
          <p class="text">优惠0元</p>
        </div>
      </block>
    </div>
    <p class="nodata">小二已经滑到底部啦，主人</p>
  </div>
</template>
 
<script>
// import { getMyWalletDetail } from "@/api";
export default {
  components: {
  },
  data() {
    return{
      list:[]
    }
  },
  onShow() {
    this.getList()
  },
  methods: {
    // 获取列表
    getList(){
      getMyWalletDetail().then(res=>{
        if(res.statusCode == '00000'){
          res.data.map(item=>{
            item.recharge = (item.recharge/100).toFixed(2)
            item.giveAway = (item.giveAway/100).toFixed(2)
            item.amountPaid = (item.amountPaid/100).toFixed(2)
          })
          this.list = res.data
        }
      })
    }
  },
  onHide() {},
  onLoad(options) {
  },
  onUnload() {
  },
  created() {}
};
</script>

<style lang="scss"  scoped>
.mingxi_box {
  min-height: 100vh;
  background: #f8f8f8;  
  .box{
    padding:30rpx;
    background: #fff;
    display: flex;
    justify-content: space-between;
    margin-top:20rpx;
    .title{
      font-size:34rpx;
    }
    .time{
      color:#999;
      font-size:30rpx;
      margin-top:10rpx;
    }
    .right{
      text-align: right;
      .price{
        font-weight: bold;
        font-size:40rpx;
      }
      .text{
        font-size:28rpx;
        color:#999;
        margin-top:10rpx;
      }
    }
  }
  .nodata{
    text-align: center;
    font-size:30rpx;
    color:#999;
    padding:30rpx 0 60rpx 0;
  }
}
</style>
